from itertools import product
from typing import List


def letterCombinations(digits: str) -> List[str]:
    words = list(map(int, list(digits)))
    w_bet = {
        2: list("abc"),
        3: list("def"),
        4: list("ghi"),
        5: list("jkl"),
        6: list("mno"),
        7: list("pqrs"),
        8: list("tuv"),
        9: list("wxyz")
    }
    if not len(digits): return []
    w = [w_bet[i] for i in words]
    c = list(product(*w))
    result = list(map(lambda x: "".join(x), c))
    return result


if __name__ == '__main__':
    r = letterCombinations("234")
    print(r)
